package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.entity.system.User;

import java.util.List;

/**
 * @author 魏锴
 * @description 针对表【tb_sys_user】的数据库操作Mapper
 * @createDate 2024-01-03 17:43:36
 * @Entity org.example.entity.system.User
 */

@Mapper
public interface UserMapper extends BaseMapper<User> {
    boolean isExited(String username);

    String getPassword(String username);

    User getUser(String username);
    User getUserById(int id);
    String getPasswordByUser(int id);

    List<User> getUserList();
    boolean insertUser(User user);
    boolean updateUser(User user);
    boolean deleteUser(int id);
    boolean updateUserInfo(@Param("user_id") int user_id,@Param("username") String username,@Param("avatar") String avatar);

    String getAvatar(int user_id);
    void saveAvatar(@Param("user_id") int user_id,@Param("file_name") String file_name);
    boolean updatePassword(@Param("password") String password,@Param("id") int id);
}




